package com.mvc.controller;


import com.common.core.BaseController;
import com.jfinal.kit.JsonKit;
import com.mvc.request.ReqPage;
import com.mvc.request.ReqVenueAddTribute;
import com.mvc.request.ReqVenueWorshipPage;
import com.mvc.request.ReturnData;
import com.mvc.response.RspPage;
import com.mvc.response.RspWorship;
import com.mvc.service.SacrificeService;
import com.mvc.service.impl.SacrificeServiceImpl;

/**
 * 祭拜
 */
public class WorshipController extends BaseController {

	SacrificeService messageService = new SacrificeServiceImpl();

	// 场馆添加选择的祭品
	public void addVenueTribute() {
		ReqVenueAddTribute req = getRequestObject(ReqVenueAddTribute.class);
		ReturnData<Boolean> data = messageService.create(req);
		renderJson(JsonKit.toJson(data));
	}

	// 获取最新祭拜记录列表【创建时间排序】
	public void queryPageWorship() {
		ReqPage req = getRequestObject(ReqPage.class);
		ReturnData<RspPage<RspWorship>> data = messageService.queryNewPage(req);
		renderJson(JsonKit.toJson(data));
	}

	// 获取场馆祭拜记录列表【创建时间排序】
	public void queryPageWorshipVenue() {
		ReqVenueWorshipPage req = getRequestObject(ReqVenueWorshipPage.class);
		ReturnData<RspPage<RspWorship>> data = messageService.queryVenuePage(req);
		renderJson(JsonKit.toJson(data));
	}
}
